<template>
    <div class="padding16">
        <div class="font_big_title">问题反馈</div>
        <SearchC :disabled='true' @click="searchClick" shape="round" placeholder="请输入遇到问题的关键词"/>
        <QuestionsC title="常见问题" :questions='questions'/>
        <div class="btn flex-row">
            <ButtonC @btnEvent='submit' name="提交反馈" round="round" :color="color.colorObj.coloe377EF6" size="normal"/>
        </div>
    </div>
</template>
<script>
import { SearchC,ButtonC } from '@/components'
import QuestionsC from './components/questions.vue'
import color from '@/assets/style/color.js';
export default({
    data(){
        return {
            color:color,
            questions: []
        }
    },
    components: {
        SearchC,
        QuestionsC,
        ButtonC
    },
    mounted(){
        this.$store.dispatch('queryDefaultQuestionList').then( res=> {
            this.questions = res
        })
    },
    methods: {
        searchClick(){
            this.$router.push({name: 'SearchPageC',
                params: {
                    // vue通过路由传参的一个bug(我猜的)，获取不到真实对象，显示[object object]，通过JSON.stringify()转化后通过JSON.parse()获取
                    questions: JSON.stringify(this.questions)
                }
            })
        },
        submit(){
            this.$router.push({name: 'SubmitCbC'})
        }
    }
})
</script>

<style lang="less" scoped>
@import '@/assets/style/style.less';
@import '@/assets/style/font.less';
@import '@/assets/style/color.less';
// 
.changeSearch{
    margin-top: @padd_margin_12;
}
.btn{
    position: fixed;
    width: 100%;
    justify-content: center;
    margin-left: -16px;
    bottom: 100px;
}
</style>